#ifndef OUTRFID_H
#define OUTRFID_H

#include <QThread>
#include <QObject>
#include "unitclass.h"
#include<QMutex>
#include<QHash>
#include"datebase.h"
#include "maintask.h"
class OutRFID : public QThread
{
    Q_OBJECT
public:
    OutRFID(int fd);
    void runThread();
    QString OutCardId;
    QString Get_CardId;//main thread get
signals:
    void signalToMainOutCardId(const QString& cid);
public:
    bool FindEPCCard();
    bool GetCardId();
    QString GetId();
    QString hexToString(unsigned char *in, int len);
    bool AnalyzeCarInfo(QString rfid, CardInfo& car_info, QHash<QString, QString> &hash);
protected:
    virtual void run();
private:
    int fd;             //串口句柄
    bool IsFind;
    int m_NoRfidTimes;
};

#endif // OUTRFID_H
